<?php

class Command extends BaseModel 
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return CActiveRecord the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'command';
	}
  
    public function relations() {
        return array(
            'user'  =>  array(self::BELONGS_TO, 'User', 'user_id', 'joinType' => 'INNER JOIN'),
        );
    }

    /**
     *
     * @return array customized attribute labels (name=>label)
     */
    public function attributeLabels()
    {
        return array(
            'cmd_id' => '命令序号',
            'cmd_type' => '命令类型',
            'submit_time' => '提交时间',
            'accept_time' => '处理时间',
            'detail'   => '详细信息',
            'state' => '状态'
        );
    }
}
